import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { MemberAddress } from '@/api/address/types';

// 定义 Store
export const useAddressStore = defineStore(
  'address',
  () => {
    // 收货地址
    const selectedAddress = ref<MemberAddress>();

    /* 商品分类 */
    const changeSelectedAddress = (val: MemberAddress) => {
    	selectedAddress.value = val
    }

    // 记得 return
    return {
      selectedAddress,
      changeSelectedAddress,
    }
  }
)